﻿@model IEnumerable<ToWaDBFirst.Models.GroupWrapper>

@{
    ViewBag.Title = "Groups";
}
<script type="text/javascript">
$(document).ready(function() 
    { 
        $("#myTable").tablesorter(); 
    } 
); 
</script>
<h2>Groups</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table id="myTable">
<thead>
    <tr>
        <th>
            Name
        </th>
        <th>
            Number of Members
        </th>
        <th>
            Member of
        </th>
    </tr>
    </thead>
    <tbody>
@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.name, "Details", new { id = item.groupId})
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.members)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.member)
        </td>
    </tr>
}
 </tbody>
</table>
